-
Notifications
You must be signed in to change notification settings - Fork 93
Add ~L, ~E, and ~e sigils for EEx and LiveView #454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hmm, shouldn't we add support for |
I wonder if we can look at what org-babel does to activate syntax highlighting on a particular region and see if we can duplicate that functionality? |
Asking around I found out we can maybe use polymode for this. I was also told that |
@axelson any chance we could get this merged in? I think it may also need a test? |
I am of the unpopular opinion that we shouldn't add anything related to Phoenix or Ecto or Absinthe or any other libraries. I understand this widely used but I don't think it belongs on this repo specifically. I believe though that this is a common issue since JSX became more popular (just my opinion) that Emacs had to deal with many modes simultaneously. Also my opinion that polymode or other alternatives might be better here as pointed by @jsmestad . As you've guessed, these are just opinions as I am not using these tools now. Fell free to totally ignore me here :) |
@victorolinasc I hear what you are saying as it can be seen as bloat for those that do not make use of Phoenix and/or LiveView. However, the alternative of having distinct packages for Is there an approach you've seen that would achieve a happy medium? I am no expert on Emacs major modes so I don't mean to "poke the bear" if I missed anything 🤲 For polymode, I would like to write something so for any sigil you can run a second major mode (not only for LiveView sigils). I have a POC working for LiveView, but I could see adding the ability for folks to enable say |
I think you are already much more enlightened than myself on the subject @jsmestad . Polymode seems to me the way to go here. We can't have two major modes assigned to the same buffer (as far as I can tell...). |
@jsmestad I'm still of the opinion that we should add @victorolinasc I definitely hear what you're saying about not bloating emacs-elixir with phoenix/ecto/etc related code, but I'm not sure that's viable in practice since it would require a significant amount of work to maintain parallel major modes to support each of those. @Trevoke any thoughts on this PR? |
@axelson yeah we can add those as well. I did have success getting polymode to work with LiveView templates. I put up a blog post with the code snippet to try it out. Could you give it a spin and see how if it works for you? |
Oooh, I'll take a look at the blog post! |
@axelson did you give it a try? Also I think we can merge in this sigil thing as-is, no? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding in ~e
and ~E
. ❤️
* Fix auto-closing quotes for heredocs Add triple double quotes (`"""`) as an auto-closing pair in the Elixir language configuration to prevent extra quotes from being inserted when starting a heredoc string. * add auto-closing pairs for sigils - add auto-closing pairs for triple double quotes with sigils - since adding those auto closing pairs breaks single double quote pairs, add pairs for single double quotes with sigils as well - the sigil list is from elixir-editors/emacs-elixir#454
* remove legacy io_request handlers we don't support OTP < R15B * rescue MatchError in :int calls Fixes elixir-editors#455 * make output device better conform to erlang I/O protocol see https://erlang.org/doc/apps/stdlib/io_protocol.html for details * return WireProtocol.send error to the caller no need to IO.warn if write fails * we are redirection stderr to stdout, use stdout as underlying device * inspect error * monitor debugged processes add test for mix task exit Fixes elixir-editors#454 * avoid debugger crashes when handling requests for no longer existing thread, frame and variable ids Fixes elixir-editors#452 * add test * forbid changes of underlying device opts * refactor and add tests coverage to invalid requests * Map.pop! is available since elixir 1.10 * run formatter
I think this is all that is needed.
Any idea how I could get highlighting to work inside the sigil by something like
web-mode
?